package club.hicode.daydayup.netty.websocket.client;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * XXXX
 *
 * @author LiuChunfu
 * @date 2018/6/18
 */
public class ClientStart {

    public static void main(String[] args) throws InterruptedException {
        NioEventLoopGroup bossGroup = new NioEventLoopGroup();

        ChannelFuture channelFuture = new Bootstrap().group(bossGroup).handler(new ClientInitlizer())
                .channel(NioSocketChannel.class)
                .connect("127.0.0.1", 12000).sync();

        Channel channel = channelFuture.channel();
        channel.writeAndFlush("1234");

    }
}
